package com.eascs.web.o2o.quartz.task;

import java.util.Date;
import org.springframework.stereotype.Component;

import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.web.o2o.quartz.util.BaseJobUtil;
import com.eascs.web.o2o.quartz.util.QuartzManager;

@Component("task2")
public class Task2 extends BaseJobUtil{

	protected final Logger logger = LoggerFactory.getLogger(getClass());
	
	//定时任务方法
	public void run(){
		Date beginDate = new Date();
		String annotionName = "task2";
		String methodName = "run";
		logger.info("开始任务:[{}]。。。。。。",annotionName+"#"+methodName);
		try {
			//业务逻辑
			int i=1/1;
		} catch (Exception e) {
			jobLogInfo(beginDate,annotionName,methodName,"0",e.getMessage()); 
			logger.info("任务异常:[{}],异常信息：[{}]。。。。。。",annotionName+"#"+methodName,e.getMessage());
			return;
		}
		jobLogInfo(beginDate,annotionName,methodName,"1",null);
		logger.info("结束任务:[{}]。。。。。。",annotionName+"#"+methodName);
	}
}
